{% extends '::backend.html.twig' %}

{% block contenido-%}
<div class="col-md-12">
<h3>{{ title_page }}</h3>
            <a href="{{ path('administracion_booking_new') }}">
																				Añadir Reserva
            </a>
    <table id="box-table-a" style="margin-top:2%;">
        <thead>
            <tr>
                <th>Ticket</th>
                <th>Fecha</th>
                <th>Importe</th>
                <th>Estado</th>
															
                <th>Comentario</th>
                <th>Cliente</th>
                <th>Producto</th>
															
                <th>Acciones</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <!--td><a href="{{ path('administracion_booking_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td-->
                <td><strong>{{ entity.bookcode }}</strong></td>
                <td title="{{ entity.created|date('Y-m-d H:i:s') }}">{{ entity.created|date('d-m-Y') }}</td>
                <td>{# entity.product.price#} €</td>
                <td>{{ entity.status }}</td>
               <!-- <td>{{ entity.paymethod}}</td>-->
																<td title="{{ entity.comment }}">{{ entity.comment | slice(0,80) }} {% if entity.comment | length > 80 %}<a class="btn btn-default btn-xs">...</a>{% endif %} </td>
																<td><a href="{{ path('administracion_customer_show', { 'id': entity.customer.id }) }}">{{ entity.customer }}</a></td>
																<td>
																{% for prod in entity.product %}
																{{ prod.name }}
																<br/>
																{% endfor %}
																</td>
             <!--   <td>{{ entity.operator}}</td>-->
                <td>
                        <a class='btn btn-xs btn-link' href='{{ path('administracion_booking_edit', { 'id': entity.id }) }}'>Editar</a>
																								{{ form(delete_form[entity.id]) }}
                </td>
            </tr>
								{% else %}
									<h6> No hay reservas para mostrar </h6>
        {% endfor %}
        </tbody>
    </table>
            <a href="{{ path('administracion_booking_new') }}">
																				Añadir Reserva
            </a>
			</div>
    {% endblock %}
